<?php
include_once("Exception.class.php");
/**
 * MyException
 * - Class of private exception extends from Exception class
 * @author Nguyen Thanh Quyen
 * @since 1.0 - 28-04-2009
 */
class MyException extends Exception {
    // Redefine the exception so message isn't optional
    public function __construct($message, $code = 0) {
        parent::__construct($message, $code);
    	$this->message = $message;
    	$this->code = $code;
    }

    // Custom string representation of object
    public function __toString() {
        return ": [{$this->code}]: {$this->message}\n";
    }
}
?>